package com.lemeshko.tdd;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class StringJoinerTest {

	@Test
	public void testJoinEmptyList() throws Exception {
		assertNull(StringJoiner
				.toCamelCaseJoinedStrings(new ArrayList<String>()));
	}

	@Test(expected = IllegalArgumentException.class)
	public void testJoinNullList() throws Exception {
		StringJoiner.toCamelCaseJoinedStrings(null);
	}

	@Test
	public void testOneElement() throws Exception {
		List<String> input = new ArrayList<String>();
		input.add("test");
		assertEquals("Test", StringJoiner.toCamelCaseJoinedStrings(input));
	}

	@Test
	public void testThreeElement() throws Exception {
		List<String> input = new ArrayList<String>();
		input.add("test");
		input.add("hEllo");
		input.add("world");
		assertEquals("TestHElloWorld",
				StringJoiner.toCamelCaseJoinedStrings(input));
	}
}
